// 公共类请求
import request from '@/utils/request'

/**
 * 获取数字字典
 * @param {*} params
 * type
 * ucenter_main_type 获取渠道 1级 获取2级 ucenter_main_type_${key}
 * ucenter_brand_type 获取品牌字典
 * ucenter_channel_platform 平台
 * ucenter_channel_type 类型
 * ucenter_platform_key 生态
 */
export function getDictList(params) {
  return request({
    url: '/cdc-system/system/dict/list',
    method: 'get',
    params
  })
}
/**
 * 获取单个字典的值
 * 接口地址: http://cdc-doc-test.risechina.com/doc.html#/third-service/%E7%B3%BB%E7%BB%9F-%E6%95%B0%E6%8D%AE%E5%AD%97%E5%85%B8/getValueUsingGET
 * @param {*} params {key:"字典key",type:'字典类型'}
 * @returns
 */
export function getDictValue(params) {
  return request({
    url: '/cdc-system/system/dict/value',
    method: 'get',
    params
  })
}
/**
 * 渠道
 */

// 获取渠道列表
export function getChannleList(params) {
  return request({
    url: '/ucenter-admin/ucenter/channel/getList',
    method: 'get',
    params
  })
}

// 获取新渠道列表
export function getChannelType(params) {
  return request({
    url: '/ucenter-admin/pub/ucenter/channel/getChannelType',
    method: 'get',
    params
  })
}

// 新增修改渠道
export function updataChannel(data) {
  return request({
    url: '/ucenter-admin/ucenter/channel/add',
    method: 'post',
    data
  })
}

// 文件上传
export function upload(params) {
  return request({
    url: '/mall-admin/oss/file/upload',
    method: 'post',
    params
  })
}

// 获取省市区列表
export function getRegionList(params) {
  return request({
    url: '/ucenter-admin/ucenter/region/getList',
    method: 'get',
    params
  })
}

// 获取oss
export function getOss(data) {
  return request({
    url: '/mall-admin/oss/sts/code',
    method: 'post',
    data
  })
}

// 视频转码
export function videoTranscoding(params) {
  return request({
    url: '/mall-admin/oss/fileChange',
    method: 'get',
    params
  })
}

// 视频列表
export function getVideosList(params) {
  return request({
    url: '/mall-admin/oss/videosList',
    method: 'get',
    params
  })
}
